package www.shw.com;

import java.math.BigDecimal;

public class Code {
	public static void main(String[] args) {
		System.out.println(Integer.MAX_VALUE);//整型最大值
		System.out.println(Integer.MIN_VALUE);//整型最小值

		System.out.println(Integer.toBinaryString(-2));//补码
		
		byte a = 4;
		byte b = 3;
		byte c = (byte) (a+b);
		int	 d = a+b;
		byte e = 3+4;
		System.out.println(c+"+"+d+"+"+e);
	
		
		char l = 89; 
		char y = 'Y'+1;  // 48 ==>0  A==>65  a==>97
		System.out.println(y);
		System.out.println(l);
	
		byte num = (byte)138; //-(128-(n-128))   
		byte num1 = (byte) 256; //-(256-n)
		System.out.println(num+"--"+num1);
		
		
		System.out.println(3/2); 	//1
		System.out.println(3/2.0);	//1.5

//结果 都是绝对值取模的结果  符号和被膜的符号一直
		System.out.println(7%2);	//1
		System.out.println(7%-2);	//1
		System.out.println(-7%2);	//-1
		System.out.println(-7%-2);	//-1
		
		byte k  = 1;
		k  = (byte) (k+1);
		k +=1;
		System.out.println(k);
		
//短路运算：如果前面表达式有结果  只打印前面的结果	
		System.out.println(a()||b());	
		System.out.println(a()&&b());
//非短路运算
		System.out.println(a()|b());	
		System.out.println(a()&b());
//每一位对应 不同取1 相同取0
		System.out.println(7^8);
		
		System.out.println(7|8);	//只要有1 就取1
		System.out.println(7&8);	//只要有0 就取0
		
//移位运算符
		/**
		 * <<:向左移运算符，7<<2=28  (乘以2的多少次方)
		 * <<:向右移运算符，正数移动之后补0，负数移动之后补1  (若能除尽，除以2的多少次方)
		 */
		
		double z1 = 1.5;
		double z2 = 1.5;
		
		double gum = z1*z2;
		System.out.println(gum);
		
	}
	
	
	public static boolean a() {
		System.out.println("aaa");
		return true;
	}
	public static boolean b() {
		System.out.println("bbb");
		return false;
	}
}
